<link type="text/css" rel="stylesheet" href="/public/js_calendar/dhtmlgoodies_calendar.css" media="screen"></LINK>
<script type="text/javascript" src="/public/js_calendar/dhtmlgoodies_calendar.js"></script>
<h2><?php echo $this->escape($this->content_title);?></h2>
<div class="form">

<?php if(!empty($this->message)) :?>
<div class="error_box"><?php echo $this->message;?></div>
<?php endif; ?>

<form class="niceform"  action="/realty/<?php echo $this->action; ?>/id/<?php echo $this->item->id; ?>" method="post">
 <input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
        <fieldset>
            
            <dl>
                <dt><label for="id">#</label></dt>
                <dd><?php echo $this->item->id ?></dd>
            </dl>        
            <dl>
                <dt><label for="today">Дата ввода данных</label></dt>
                <dd><input type="text" size="10" id="today" name="today" value="<?php echo $this->escape(trim($this->item->today));?>">
                <img id="today_trigger" src="/public/images/cal.gif" style="padding:6px;" onclick="displayCalendar(document.getElementById('today'),'yyyy-mm-dd',this);"></dd>
            </dl>
            <dl>
                <dt><label for="city">Город</label></dt>
                <dd>
                    <select id="city" name="city" size="1">
                        <?php foreach($this->citys as $key=>$value) { ?> 
                        <option value="<?php echo $key;?>" <?php echo $this->escape(trim($this->item->city))==$key?' selected ':'';?>><?php echo $value;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl>        
            <dl>
                <dt><label for="street">Микрорайон (Улица)</label></dt>
                <dd><input type="text" size="54" id="street" name="street" value="<?php echo $this->escape(trim($this->item->street));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="region">Район</label></dt>
                <dd><input type="text" size="54" id="region" name="region" value="<?php echo $this->escape(trim($this->item->region));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="house">Номер дома</label></dt>
                <dd><input type="text" size="54" id="house" name="house" value="<?php echo $this->escape(trim($this->item->house));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="flats">Количество комнат</label></dt>
                <dd><input type="text" size="54" id="flats" name="flats" value="<?php echo $this->escape(trim($this->item->flats));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="type">Тип дома</label></dt>
                <dd>
                    <select id="type" name="type" size="1">
                        <?php foreach($this->types as $key=>$value) { ?> 
                        <option value="<?php echo $key;?>" <?php echo $this->escape(trim($this->item->type))==$key?' selected ':'';?>><?php echo $value;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl>        
            <dl>
                <dt><label for="walls">Материал стен</label></dt>
                <dd><input type="text" size="54" id="walls" name="walls" value="<?php echo $this->escape(trim($this->item->walls));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="floors">Этажность</label></dt>
                <dd><input type="text" size="54" id="floors" name="floors" value="<?php echo $this->escape(trim($this->item->floors));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="floor">Этаж</label></dt>
                <dd><dd><input type="text" size="54" id="floor" name="floor" value="<?php echo $this->escape(trim($this->item->floor));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="square">Площадь общая, кв.м</label></dt>
                <dd><input type="text" size="54" id="square" name="square" value="<?php echo $this->escape(trim($this->item->square));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="renovation">Наличие ремонта</label></dt>
                <dd>
                    <select id="renovation" name="renovation" size="1">
                        <?php foreach($this->renovations as $key=>$value) { ?> 
                        <option value="<?php echo $key;?>" <?php echo $this->escape(trim($this->item->renovation))==$key?' selected ':'';?>><?php echo $value;?></option>
                        <?php } ?>
                    </select>
                </dd>
            </dl>        
            <dl>
                <dt><label for="price">Цена предложения (тенге)</label></dt>
                <dd><input type="text" size="54" id="price" name="price" value="<?php echo $this->escape(trim($this->item->price));?>"></dd>
            </dl>        
            <dl>
                <dt><label for="source">Источник информации</label></dt>
                <dd><textarea id="source" name="source"  rows="5" cols="36"><?php echo $this->escape(trim($this->item->source));?></textarea></dd> 
            </dl>
            <dl>
                <dt><label for="description">Описание</label></dt>
                <dd><textarea id="description" name="description"  rows="5" cols="36"><?php echo $this->escape(trim($this->item->description));?></textarea></dd> 
            </dl>
                    <dl class="submit">
            <a href="javascript:document.forms[0].submit();" class="bt_blue"><span class="bt_blue_lft"></span><strong>Save</strong><span class="bt_blue_r"></span></a>
            <a href="/realty" class="bt_blue"><span class="bt_blue_lft"></span><strong>Cancel</strong><span class="bt_blue_r"></span></a>
         </dl>
    </fieldset>
        
 </form>
</div>  